/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.unmsm.pacis.shca.domain.entity;

import java.io.Serializable;
import javax.persistence.*;

/**
 *
 * @author solriver
 */
@Entity
@Table(name = "dato_socioeconomico", catalog = "bdshca")
@NamedQueries({
    @NamedQuery(name = "DatoSocioeconomico.findAll", query = "SELECT d FROM DatoSocioeconomico d"),
    @NamedQuery(name = "DatoSocioeconomico.findByIdDatoSocioeconomico", query = "SELECT d FROM DatoSocioeconomico d WHERE d.idDatoSocioeconomico = :idDatoSocioeconomico")})
public class DatoSocioeconomico implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_dato_socioeconomico")
    private Integer idDatoSocioeconomico;
    @JoinColumn(name = "nso_id_factor_socioeconomico", referencedColumnName = "id_nombre_socioeconomico")
    @ManyToOne(optional = false)
    private NombreSocioeconomico nsoIdFactorSocioeconomico;
    @JoinColumn(name = "vis_id_visita_domiciliaria", referencedColumnName = "id_visita_domiciliaria")
    @ManyToOne(optional = false)
    private VisitaDomiciliaria visIdVisitaDomiciliaria;

    public DatoSocioeconomico() {
    }

    public DatoSocioeconomico(Integer idDatoSocioeconomico) {
        this.idDatoSocioeconomico = idDatoSocioeconomico;
    }

    public Integer getIdDatoSocioeconomico() {
        return idDatoSocioeconomico;
    }

    public void setIdDatoSocioeconomico(Integer idDatoSocioeconomico) {
        this.idDatoSocioeconomico = idDatoSocioeconomico;
    }

    public NombreSocioeconomico getNsoIdFactorSocioeconomico() {
        return nsoIdFactorSocioeconomico;
    }

    public void setNsoIdFactorSocioeconomico(NombreSocioeconomico nsoIdFactorSocioeconomico) {
        this.nsoIdFactorSocioeconomico = nsoIdFactorSocioeconomico;
    }

    public VisitaDomiciliaria getVisIdVisitaDomiciliaria() {
        return visIdVisitaDomiciliaria;
    }

    public void setVisIdVisitaDomiciliaria(VisitaDomiciliaria visIdVisitaDomiciliaria) {
        this.visIdVisitaDomiciliaria = visIdVisitaDomiciliaria;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDatoSocioeconomico != null ? idDatoSocioeconomico.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DatoSocioeconomico)) {
            return false;
        }
        DatoSocioeconomico other = (DatoSocioeconomico) object;
        if ((this.idDatoSocioeconomico == null && other.idDatoSocioeconomico != null) || (this.idDatoSocioeconomico != null && !this.idDatoSocioeconomico.equals(other.idDatoSocioeconomico))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.unmsm.pacis.shca.domain.entity.DatoSocioeconomico[ idDatoSocioeconomico=" + idDatoSocioeconomico + " ]";
    }
    
}
